<script>
import Store from '@/stores/vuex'

export default {
	onLaunch() {
		console.log('App Launch')
		console.log(process.env.UNI_PLATFORM)
		this.setMpWxPos()
	},
	onShow: function () {
		console.log('App Show')
	},
	onHide: function () {
		console.log('App Hide')
	},
	methods: {
		setMpWxPos() {
			console.log('setMpWxPos')
			// 微信位置数据
			let mpWxPos = this.$store.getters['mpWxPos/getMpWxPos']
			mpWxPos = Object.assign(mpWxPos, uni.getMenuButtonBoundingClientRect())
			const systemInfo = uni.getSystemInfoSync()
			mpWxPos.bothSideMargin = systemInfo.windowWidth - mpWxPos.right
			mpWxPos.headerHeight = mpWxPos.top + mpWxPos.height + 10
			mpWxPos.logoTop = 4
			mpWxPos.logoHeight = mpWxPos.height - mpWxPos.logoTop * 2
			mpWxPos.logoWidth = (mpWxPos.logoHeight * 324) / 76
			this.$store.commit('mpWxPos/updateMpWxPos', mpWxPos)
		}
	}
}
</script>

<style lang="scss">
/*每个页面公共css */
@import 'uview-plus/index.scss';
</style>
